﻿using System;
using System.Web;

using BrnMall.Core;

namespace BrnMall.Services
{
    /// <summary>
    /// 上传操作管理类
    /// </summary>
    public partial class Uploads
    {
        private static IUploadStrategy _iuploadstrategy = BMAUpload.Instance;//上传策略

        /// <summary>
        /// 保存上传的用户头像
        /// </summary>
        /// <param name="avatar">用户头像</param>
        /// <returns></returns>
        public static string SaveUploadUserAvatar(HttpPostedFileBase avatar)
        {
            return _iuploadstrategy.SaveUploadUserAvatar(avatar);
        }

        public static string SaveUploadUserReview(HttpPostedFileBase review)
        {
            return _iuploadstrategy.SaveUploadUserReview(review);
        }
        public static string SaveUploadUserTimeLine(HttpPostedFileBase review)
        {
            return _iuploadstrategy.SaveUploadUserTimeLine(review);
        }
        /// <summary>
        /// 保存上传的用户等级头像
        /// </summary>
        /// <param name="avatar">用户等级头像</param>
        /// <returns></returns>
        public static string SaveUploadUserRankAvatar(HttpPostedFileBase avatar)
        {
            return _iuploadstrategy.SaveUploadUserRankAvatar(avatar);
        }

        /// <summary>
        /// 保存上传的品牌logo
        /// </summary>
        /// <param name="logo">品牌logo</param>
        /// <returns></returns>
        public static string SaveUploadBrandLogo(HttpPostedFileBase logo)
        {
            return _iuploadstrategy.SaveUploadBrandLogo(logo);
        }

        /// <summary>
        /// 保存新闻编辑器中的图片
        /// </summary>
        /// <param name="image">新闻图片</param>
        /// <returns></returns>
        public static string SaveNewsEditorImage(HttpPostedFileBase image)
        {
            return _iuploadstrategy.SaveNewsEditorImage(image);
        }
        /// <summary>
        /// 保存组件中的图片
        /// </summary>
        /// <param name="storeId"></param>
        /// <param name="image"></param>
        /// <returns></returns>
        public static string SaveWidgetImage(int storeId,HttpPostedFileBase image)
        {
            return _iuploadstrategy.SaveWidgetImage(storeId,image);
        }
        /// <summary>
        /// 保存帮助编辑器中的图片
        /// </summary>
        /// <param name="image">帮助图片</param>
        /// <returns></returns>
        public static string SaveHelpEditorImage(HttpPostedFileBase image)
        {
            return _iuploadstrategy.SaveHelpEditorImage(image);
        }

        /// <summary>
        /// 保存商品编辑器中的图片
        /// </summary>
        /// <param name="storeId">店铺id</param>
        /// <param name="image">商品图片</param>
        /// <returns></returns>
        public static string SaveProductEditorImage(int storeId, HttpPostedFileBase image)
        {
            return _iuploadstrategy.SaveProductEditorImage(storeId, image);
        }

        /// <summary>
        /// 保存上传的商品图片
        /// </summary>
        /// <param name="storeId">店铺id</param>
        /// <param name="image">商品图片</param>
        /// <returns></returns>
        public static string SaveUplaodProductImage(int storeId, HttpPostedFileBase image)
        {
            return _iuploadstrategy.SaveUplaodProductImage(storeId, image);
        }

        /// <summary>
        /// 保存上传的广告图片
        /// </summary>
        /// <param name="image">广告图片</param>
        /// <returns></returns>
        public static string SaveUploadAdvertImage(HttpPostedFileBase image)
        {
            return _iuploadstrategy.SaveUploadAdvertImage(image);
        }

        /// <summary>
        /// 保存上传的友情链接Logo
        /// </summary>
        /// <param name="logo">友情链接logo</param>
        /// <returns></returns>
        public static string SaveUploadFriendLinkLogo(HttpPostedFileBase logo)
        {
            return _iuploadstrategy.SaveUploadFriendLinkLogo(logo);
        }

        /// <summary>
        /// 保存上传的店铺等级头像
        /// </summary>
        /// <param name="avatar">店铺等级头像</param>
        /// <returns></returns>
        public static string SaveUploadStoreRankAvatar(HttpPostedFileBase avatar)
        {
            return _iuploadstrategy.SaveUploadStoreRankAvatar(avatar);
        }

        /// <summary>
        /// 保存上传的店铺logo
        /// </summary>
        /// <param name="storeId">店铺id</param>
        /// <param name="logo">店铺logo</param>
        /// <returns></returns>
        public static string SaveUploadStoreLogo(int storeId, HttpPostedFileBase logo)
        {
            return _iuploadstrategy.SaveUploadStoreLogo(storeId, logo);
        }
        /// <summary>
        /// 小程序二维码
        /// </summary>
        /// <param name="storeId">店铺id</param>
        /// <param name="logo">店铺weapp_qrcode</param>
        /// <returns></returns>
        public static string SaveUploadStoreWeappCode(int storeId, HttpPostedFileBase weapp_qrcode)
        {
            return _iuploadstrategy.SaveUploadStoreWeappCode(storeId, weapp_qrcode);
        }
        /// <summary>
        /// 订阅宝二维码
        /// </summary>
        /// <param name="storeId">店铺id</param>
        /// <param name="weservice_qrcode">店铺weservice_qrcode</param>
        /// <returns></returns>
        public static string SaveUploadStoreWeServiceCode(int storeId, HttpPostedFileBase weservice_qrcode)
        {
            return _iuploadstrategy.SaveUploadStoreWeServiceCode(storeId, weservice_qrcode);
        }

        /// <summary>
        /// 保存上传的店铺banner
        /// </summary>
        /// <param name="storeId">店铺id</param>
        /// <param name="banner">店铺banner</param>
        /// <returns></returns>
        public static string SaveUploadStoreBanner(int storeId, HttpPostedFileBase banner)
        {
            return _iuploadstrategy.SaveUploadStoreBanner(storeId, banner);
        }
        /// <summary>
        /// 上传店铺分类Logo
        /// </summary>
        /// <param name="storeId">店铺id</param>
        /// <param name="logo">分类LOGO</param>
        /// <returns></returns>
        public static string SaveUploadStoreClass(int storeId, HttpPostedFileBase logo)
        {
            return _iuploadstrategy.SaveUploadStoreClass(storeId, logo);
        }
        /// <summary>
        /// 保存证书
        /// </summary>
        /// <param name="storeId"></param>
        /// <param name="cert"></param>
        /// <returns></returns>
        public static string SaveCertFile(int storeId, HttpPostedFileBase cert)
        {
            return _iuploadstrategy.SaveCertFile(storeId, cert);
        }

        /// <summary>
        /// 保存用户的分销二维码
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static string SaveUploadUserWxaCode(string path)
        {
            return _iuploadstrategy.SaveUploadUserWxaCode(path);
        }

        /// <summary>
        /// 上传名片头像
        /// </summary>
        /// <param name="image"></param>
        /// <returns></returns>
        public static string SaveUploadStoreCardAvater(HttpPostedFileBase image)
        {
            return _iuploadstrategy.SaveUploadStoreCardAvater(image);
        }

        /// <summary>
        /// 保存名片商圈图片
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static string SaveUploadStoreBlogImage(int storeId, HttpPostedFileBase image)
        {
            return _iuploadstrategy.SaveUploadStoreBlogImage(storeId, image);
        }
    }
}
